package com.cr.admin.business.store.controller;

import com.cr.admin.business.banner.pojo.entity.Banner;
import com.cr.admin.business.banner.pojo.query.BannerQuery;
import com.cr.admin.business.store.pojo.entity.Store;
import com.cr.admin.business.store.pojo.query.StoreQuery;
import com.cr.admin.business.store.service.StoreService;
import com.cr.common.response.JsonResult;
import com.cr.common.response.PageData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "门店管理")
@RequestMapping("/api/bus/store")
public class StoreController {

    @Autowired
    private StoreService storeService;

    @ApiOperation(value = "查询横幅列表")
    @GetMapping
    public JsonResult list(StoreQuery storeQuery) {
        PageData<Store> pageData = PageData.page(storeQuery.getPageNum(), storeQuery.getPageSize(), () -> storeService.list(storeQuery));
        return JsonResult.success(pageData);
    }
}
